<%@page import="com.shsh.safemanage.model.Problem"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.PostCheckDao"%>
<%@page import="com.shsh.safemanage.model.PostcheckMonthSanweiReport"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.PostcheckMonthQualityReport"%>
<%@page import="com.shsh.safemanage.util.RequestUtil"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%
{
	Integer year = RequestUtil.getParameter(request, Constants.REQUEST_PARAMETER_YEAR, 0);
	Integer month = RequestUtil.getParameter(request, Constants.REQUEST_PARAMETER_MONTH, 0);
	
	PostCheckDao sanweiPostcheckDao = DaoCreator.createPostCheckDao();
	ProblemDao sanweiProblemDao = DaoCreator.createProblemDao();
	
	PostcheckMonthSanweiReport sanweiReport = sanweiPostcheckDao.getCorpMonthSanweiReport(year, month);
	
	boolean canWrite = true;
	if(sanweiReport == null) {
		canWrite = false;
	} else {
		Long corpSanweiProblemID = sanweiReport.getProblemID();
		if(corpSanweiProblemID == null){
			canWrite = false;
		} else {
			Problem corpProblem = sanweiProblemDao.getProblemByID(corpSanweiProblemID);
			canWrite = corpProblem.getCloseUserID() != null;
		}		
	}

	
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：上海高桥分公司问题管理平台 &gt;&gt; 岗检汇总统计 &gt;&gt;公司<%=month %>月岗检质量评价表
</div>
<%
if(!canWrite) {
%>
<!-- 已填报 -->

<div class="content" style="">
	<div style="float:left;padding-left:45%;padding-top:80px;font-size:14px;font-weight:bold;font-family:'微软雅黑','宋体';">请先填报《公司“三违”现象问题汇总》</div>
</div>
<%
return;
}
%>
<div class="content" style="">
<div>
	<jsp:include page="write_month_quality_shiyebu.jsp"></jsp:include>
</div>
<%
PostcheckMonthQualityReport report = (PostcheckMonthQualityReport) request.getAttribute(Constants.REQUEST_ATTRIBUTE_POSTCHECK_MONTH_QUALITY_REPORT);
if(report != null && report.getChushiReportMap().size()>0){
%>
<div>
	<jsp:include page="write_month_quality_chushi.jsp"></jsp:include>
</div>
</div>
<%
}
%>

<%
}
%>